package cn.com.sinosoft.ares.insurance.service.exception;

import cn.com.sinosoft.ares.insurance.service.constant.InsuranceError;

/**
 * Description: 产品不存在
 * Author: lishangmin
 * Created: 2018-06-20 17:20
 */
public class ProductNotExistException extends RuntimeException {

    //错误代码
    private String code;

    public ProductNotExistException() {
        super(InsuranceError.PRODUCT_NOT_EXIST_ERROR.getMsg());
        this.code = InsuranceError.PRODUCT_NOT_EXIST_ERROR.getStatus();
    }

    public ProductNotExistException(String code) {
        this.code = code;
    }

    public ProductNotExistException(String code, String message) {
        super(message);
        this.code = code;
    }

    public ProductNotExistException(String code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public ProductNotExistException(Throwable cause, String code) {
        super(cause);
        this.code = code;
    }

    public ProductNotExistException(Throwable cause) {
        super(cause);
    }

    public ProductNotExistException(InsuranceError resultCode){
        super(resultCode.getMsg());
        this.code = resultCode.getStatus();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

}
